﻿#pragma once

#include "KuaDu/Core/Base.h"

#pragma warning(push, 0)
#include <spdlog/spdlog.h>
#include <spdlog/fmt/ostr.h>
#pragma warning(pop)

namespace KD {

	class Log
	{
	public:
		static void Init();

		static Ref<spdlog::logger>& GetCoreLogger() { return s_CoreLogger; }
		static Ref<spdlog::logger>& GetClientLogger() { return s_ClientLogger; }
	private:
		static Ref<spdlog::logger> s_CoreLogger;
		static Ref<spdlog::logger> s_ClientLogger;
	};

}
// 核心日志宏指令
#define KD_CORE_TRACE(...)		::KD::Log::GetCoreLogger()->trace(__VA_ARGS__)
#define KD_CORE_INFO(...)		::KD::Log::GetCoreLogger()->info(__VA_ARGS__)
#define KD_CORE_WARN(...)		::KD::Log::GetCoreLogger()->warn(__VA_ARGS__)
#define KD_CORE_ERROR(...)		::KD::Log::GetCoreLogger()->error(__VA_ARGS__)
#define KD_CORE_CRITICAL(...)	::KD::Log::GetCoreLogger()->critical(__VA_ARGS__)
// 客户端日志宏指令
#define KD_TRACE(...)			::KD::Log::GetClientLogger()->trace(__VA_ARGS__)
#define KD_INFO(...)			::KD::Log::GetClientLogger()->info(__VA_ARGS__)
#define KD_WARN(...)			::KD::Log::GetClientLogger()->warn(__VA_ARGS__)
#define KD_ERROR(...)			::KD::Log::GetClientLogger()->error(__VA_ARGS__)
#define KD_CRITICAL(...)		::KD::Log::GetClientLogger()->critical(__VA_ARGS__)
